﻿@{
	ViewBag.Title = "Unobtrusive Ajax";
}
@using System.Web.Optimization
@using X.PagedList.Mvc;

@Styles.Render("~/Content/PagedList.css")

<h2>Unobtrusive Ajax</h2>

<p>Example of paging a list:</p>
<div id="unobtrusive">
	@Html.Partial("UnobtrusiveAjax_Partial")
</div>
<div id="oncomplete"></div>

@section Scripts{
	<script type="text/javascript" src="/Scripts/jquery.unobtrusive-ajax.min.js"></script>	
	<script>
		function PagedOnComplete(obj) {
			console.log(obj);
			var $oncomplete = $('#oncomplete');
			$oncomplete
				.text('Paging operation completed.')
				.css('backgroundColor', 'yellow')
				.fadeOut({complete: function () {
					$oncomplete.css('backgroundColor', 'transparent').text('').show();
				}});
		}
	</script>
}